<%@ include file="/html/bjp/seekersprofile/init.jsp" %>

<%
	long userId = PortalUtil.getUserId(request);
	List listProfiles = ProfileLocalServiceUtil.getByUserId(userId);
%>

<liferay-portlet:renderURL var="url" windowState="<%= WindowState.NORMAL.toString() %>" portletName="seekersprofile">
	<portlet:param name="struts_action" value="/bjp/seekersprofile/manage" />
</liferay-portlet:renderURL>

<%
	for (int i=0; i<5 && Validator.isNotNull(listProfiles); i++) {
		Profile profile = null;
		if (listProfiles.size() > 0 && i<listProfiles.size()) 
			profile = (Profile)listProfiles.get(i);
		if (profile != null) {
		%>
		<table width="80%" style="border: 2px solid lightsteelblue;background-color: #A8A8A8">
			<tr>
				<td colspan='2'><%= profile.getFirstName() %></td>
			</tr>
			<tr>
				<td width='40%'>
					<%if(profile.getPhoto() > 0l){%>
						<a href="<%= url %>&<%=Constants.CMD%>=<%= Constants.PREVIEW %>&profileId=<%= String.valueOf(profile.getProfileId())%>"><img src="<%= themeDisplay.getPathMain()%>/ext/reports/image?imageId=<%=profile.getPhoto()%>&compressed=true&size=small" /></a>
					<%}else{%>
						<a href="<%= url %>&<%=Constants.CMD%>=<%= Constants.PREVIEW %>&profileId=<%= String.valueOf(profile.getProfileId())%>"><img src="/html/themes/classic/images/bjp/empty.jpg" height="50px" width="40px"/></a>
					<%}%>
				</td>
				
			</tr>
		</table><br/>
		<% } else { %>
			<table width="80%" style="border: 2px solid lightsteelblue;background-color: tan" >
				<tr><td>Please add the profile</td></tr>
				<tr>
					<td><a href="<%= url %>&<%= Constants.CMD %>=<%= Constants.ADD %>" > Add &raquo;</a><br/></td>
				</tr>
			</table><br/>
	<% } } %>

<%--action="<liferay-portlet:actionURL windowState="<%= WindowState.NORMAL.toString() %>" portletName="seekersprofile">
	<portlet:param name="struts_action" value="/bjp/seekersprofile/manage" />
	</liferay-portlet:actionURL>"
	onClick="manage()"
	--%>